module.exports = function (path, data) {
  return new Promise((reslove, reject) => {
    wx.request({
      url: "http://127.0.0.1:8012/api" + path,
      data: data,
      method: data === undefined ? "get" : "post",
      header: {
        'Content-type':'json'
      },
      success: reslove,
      fail: function() {
        reject()
        wx.showModal({
          showCancel: false,
          title:'失败'
        })
      }
    })
  })
}